#include <iostream>
using namespace std;
int main()
{
    char clock[3][31] = {" _     _  _     _  _  _  _  _ ",
                         "| |  | _| _||_||_ |_   ||_||_|",
                         "|_|  ||_  _|  | _||_|  ||_| _|"};

    unsigned int num[4];
    while(std::cin >> num[0] >> num[1] >> num[2] >> num[3])
    {
        for(int l = 0; l < 3; ++l)
        {
            char *outline = clock[l];
            for(int i = 0; i < 4; ++i)
            {
                cout<<outline[3*num[i]]<<outline[3*num[i]+1]<<outline[3*num[i]+2];
            }
            cout<<endl;
        }
    }

    return 0;
}